<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <!-- 
        需求：我想知道我们按的时哪一个案件
     -->

     <script>
         document.addEventListener("keydown",function(e){
             if(e.key=='Enter'){
                 console.log("这是回车键")
             }
         })
     </script>
    
</body>
</html>